/* Copyright (C) 2010 Luca Piccinelli
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "prj_definitions.h"
#include "generators/resource/AbstractFileGenerator.h"

#include <boost/filesystem.hpp>

#include <string>
#include <sstream>
#include <algorithm>

using namespace std;
using namespace boost::filesystem;

namespace NAMESPACE{

// ****** AbstractFileGenerator implementation ****************************

//  _____________________________________________________
// |   Standard constructors                             |
// |_____________________________________________________|

AbstractFileGenerator::~AbstractFileGenerator(){
    if(is_open) close();
}

AbstractFileGenerator::AbstractFileGenerator() : AbstractResourceGenerator(){}
AbstractFileGenerator::AbstractFileGenerator(const AbstractFileGenerator& g){}
AbstractFileGenerator& AbstractFileGenerator::operator=(const AbstractFileGenerator& g){
    if(this == &g) return *this;

    AbstractResourceGenerator::operator =(g);

    return *this;
}
// ......................................................


//  _____________________________________________________
// |   Others constructors                               |
// |_____________________________________________________|

AbstractFileGenerator::AbstractFileGenerator(const string& _resource,
                                             const memory_size_t& _max_mem)
                                             : AbstractResourceGenerator(_resource, _max_mem){}
AbstractFileGenerator::AbstractFileGenerator(const IOKey& k,
                                             const memory_size_t& _max_mem)
                                             : AbstractResourceGenerator(k, _max_mem){}
AbstractFileGenerator::AbstractFileGenerator(const string& _resource,
                                             const IOKey& k,
                                             const memory_size_t& _max_mem)
                                             : AbstractResourceGenerator(_resource, k, _max_mem){}
// ......................................................

AbstractFileGenerator& AbstractFileGenerator::open(){
    is_open = true;
    return *this;
}

AbstractFileGenerator& AbstractFileGenerator::close(){
    return *this;
}

// -----------------------------------------------------------------------------

}
